public class Test3 {
    //编译时异常必须throws
    public static void main1(String[] args) throws my_Exception {
        int a = 10;
        if (a == 10) {
            throw new my_Exception("我的异常");
        }
    }
    //运行时异常不用throws
    public static void main(String[] args) {
        int a = 10;
        if (a == 10) {
            throw new myException("我的异常");
        }
    }
}
